package com.zhijian.warehouse.manage.dao;

import com.zhijian.warehouse.manage.entity.po.UserGroupOrClass;
import com.zhijian.warehouse.manage.entity.vo.request.UserGroupOrClassSearchVo;
import com.zhijian.warehouse.manage.entity.vo.response.UserGroupOrClassVo;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface UserGroupOrClassMapper {
    int deleteByPrimaryKey(Long id);

    int insert(UserGroupOrClass record);

    int insertSelective(UserGroupOrClass record);

    UserGroupOrClass selectByPrimaryKey(Long id);

    /**
     * 根据名称与类型查询
     *
     * @param name
     * @param type
     * @return
     */
    UserGroupOrClass selectByNameAndType(@Param("name") String name, @Param("type") Byte type);

    int updateByPrimaryKeySelective(UserGroupOrClass record);

    int updateByPrimaryKey(UserGroupOrClass record);

    /**
     * 查询总数
     *
     * @param userGroupOrClassSearchVo
     * @return
     */
    int count(UserGroupOrClassSearchVo userGroupOrClassSearchVo);

    /**
     * 查询列表
     *
     * @param userGroupOrClassSearchVo
     * @return
     */
    List<UserGroupOrClassVo> selectList(UserGroupOrClassSearchVo userGroupOrClassSearchVo);

    /**
     * 根据ID查询vo
     *
     * @param id
     * @return
     */
    UserGroupOrClassVo selectVoById(Long id);

    /**
     * 批量删除
     *
     * @param idList
     * @return
     */
    void deleteByIdList(@Param("idList") List<Long> idList);

    /**
     * 批量新增
     *
     * @param entities
     * @return
     */
    int insertBatch(@Param("entities") List<UserGroupOrClass> entities);
}